<style scoped>
  .layout-con {
    height: 100%;
    width: 100%;
  }

  .menu-item span {
    display: inline-block;
    overflow: hidden;
    width: 69px;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    transition: width .2s ease .2s;
  }

  .menu-item i {
    transform: translateX(0px);
    transition: font-size .2s ease, transform .2s ease;
    vertical-align: middle;
    font-size: 16px;
  }

  .collapsed-menu span {
    width: 0px;
    transition: width .2s ease;
  }

  .collapsed-menu i {
    transform: translateX(5px);
    transition: font-size .2s ease .2s, transform .2s ease .2s;
    vertical-align: middle;
    font-size: 22px;
  }

  .title-top-center {
    text-align: center;

  }

  .title-top-right {
    float: right
  }

  .btn_tools {
    padding: 6px 10px 6px 10px;
    background: #eee;
    border-radius: 20px;
  }

  .ivu-cell-extra {
    color: #ed4014;
  }
</style>
<template>
  <Row type="flex" justify="center" align="top" class="code-row-bg">
    <Col span="1" style="background:#3F88D5;height:100vh;">
        <NavLeft :selected="1" :avatar="avatar"></NavLeft>
    </Col>
    <Col span="4">
    <NavMiddle :itemList="itemList"></NavMiddle>
    </Col>
	<Col span="19" style="background:#f5f7f9;height:100vh;">
      <Layout>
        <Content :style="{padding: '0 16px 16px'}">
          <Breadcrumb :style="{margin: '16px 0'}">
            <Row type="flex" justify="space-between">
              <Col span="6">
                <a type="text" size="large" @click="$router.back(-1)">
                  <Icon type="ios-arrow-back"></Icon>
                  返回
                </a>

              </Col>
              <Col span="12" class="title-top-center"
                   style="font-size: 16px; font-weight: bold; color: rgb(70, 76, 91);text-align:center;">班组详情
              </Col>
              <Col span="6">

              </Col>
            </Row>

          </Breadcrumb>
          <Card :bordered="true" dis-hover class="pushCard">
            <div slot="title" style="">
              <Button shape="circle" :to="{path:'/item/parameter',query:{id:unit_id}}">主要参数</Button>
              <Button shape="circle" style="margin-left:6px;" :to="{path:'/item/rules',query:{id:unit_id}}">成绩规则
              </Button>
              <Button shape="circle" style="margin-left:6px;"
                      :to="{path:'/item/push',query:{id:unit_id}}">推送等级
              </Button>
              <Button type="primary" shape="circle" style="margin-left:6px;" :to="{path:'/item/manager',query:{id:unit_id}}">管理等级
              </Button>
              <Button shape="circle" style="margin-left:6px;" :to="{path:'/item/members',query:{id:unit_id}}">人员列表
              </Button>
              <Button shape="circle" style="margin-left:6px;" :to="{path:'/item/info',query:{id:unit_id}}">单元信息</Button>
            </div>
          </Card>
          <div class="peoDiv">
            <Card class="peoples">
              <div class="titleDiv">
                <span class="td_left">蓝色</span>
                <span class="td_right">添加</span>
              </div>
              <div class="people">
                <div class="peo">
                  <Icon type="ios-close-circle" />
                  <div class="peo_photo"><img src="../../assets/img/tx.jpg"/></div>
                  <span class="peo_name">夏拥才</span>
                </div>
                <div class="peo">
                  <Icon type="ios-close-circle" />
                  <div class="peo_photo"><img src="../../assets/img/tx.jpg"/></div>
                  <span class="peo_name">夏拥才</span>
                </div>
              </div>
            </Card>
            <Card class="peoples">
              <div class="titleDiv">
                <span class="td_left">黄色</span>
                <span class="td_right">添加</span>
              </div>
              <div class="people">
                <div class="nullPeo">未选择不推送</div>
              </div>
            </Card>
            <Card class="peoples">
              <div class="titleDiv">
                <span class="td_left">橙色</span>
                <span class="td_right">添加</span>
              </div>
              <div class="people">
                <div class="nullPeo">未选择不推送</div>
              </div>
            </Card>
            <Card class="peoples">
              <div class="titleDiv">
                <span class="td_left">红色</span>
                <span class="td_right">添加</span>
              </div>
              <div class="people">
                <div class="nullPeo">未选择不推送</div>
              </div>
            </Card>
          </div>
        </Content>
      </Layout>
    </Col>
  </Row>
</template>
<script>
  import cookie from 'js-cookie';
  import NavLeft from '@/components/NavLeft';
  import NavMiddle from '@/components/NavMiddle';
  export default {
    data() {
      return {
        isCollapsed: false,
        itemList: [],
        itemInfo: [],
        tjList: [],
        chooseDate: cookie.get('chooseDate'),
        unit_id: "",
        avatar: ""
      };
    },
	components: { NavLeft: NavLeft,NavMiddle:NavMiddle },
    methods: {
      getData() {
        var uid = cookie.get('uid');
        var token = cookie.get('token');
        var unit_id = localStorage.getItem('middleId')
        if (!unit_id) {
          this.$Message.warning('无参数不能访问');
          return;
          //store.dispatch('setLoginStatus', 0)
          //window.location.reload()
        }
        this.$Loading.start();
        var str = {unit_id: unit_id, loginType: cookie.get('loginType'),ymd: this.chooseDate};
        var strdata = this.$twjsdes.enstr(str);
        this.$http.post(this.$API_URL + '/item/detail', {alldata: strdata.alldata}).then((response) => {
          this.$Loading.finish();
          var res = this.$twjsdes.decrypt(response.data.alldata);
          if (res.status == -1 && res.data.backurl) {
            this.$Modal.warning({
              title: '提示',
              content: '请在企业微信授权登录后使用',
              onOk: () => {
                window.location.href = res.data.backurl
              }
            });

          } else if (res.status != 1) {
            this.$Message.error(res.msg);
          } else {
            console.log(res.data);
            this.itemList = res.data.item_all_list;
            this.itemInfo = res.data;
            this.tjList = res.data.list;
            localStorage.setItem('middleId',res.data.unit_id)
            this.avatar = res.data.avatar;
          }
        }).catch(function (error) {
          this.$Modal.error({
            title: '提示',
            content: '网络连接错误，请检查后重试'
          });
          //console.log(error);
        });
      },
    },
    computed: {
      menuitemClasses: function () {
        return [
          'menu-item',
          this.isCollapsed ? 'collapsed-menu' : ''
        ]
      }
    },
    created() {
      window.document.title = 'SCS设置';
      this.getData();
    },
    mounted() {
    }
  }
</script>
<style lang="less">
  .pushCard{
    .ivu-card-head{
      border-bottom: none;
    }
    .ivu-card-body{
      display: none;
    }
  }
  .peoDiv{
    height: 800px;
    overflow-y: auto;
    .peoples{
      width: 100%;
      display: flex;
      flex-direction: column;
      margin-top: 10px;
      .ivu-card-body{
        padding-bottom: 0;
      }
      .titleDiv{
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 10px;
        .td_left{
          font-size: 16px;
          color: #333333;
          line-height: 16px;
        }
        .td_right{
          font-size: 15px;
          color: #3f8fe0;
          line-height: 16px;
          cursor: pointer;
        }
      }
      .people{
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        .nullPeo{
          font-size: 14px;
          color: #999999;
          margin-bottom: 16px;
        }
        .peo{
          width: 113px;
          height: 45px;
          background: #f9f9f9;
          border: 1px solid #e5e5e5;
          display: flex;
          flex-direction: row;
          padding-left: 15px;
          box-sizing: border-box;
          position: relative;
          margin-right: 16px;
          margin-bottom: 16px;
          .ivu-icon{
            position: absolute;
            right: -9px;
            top: -9px;
            color: #f15c60;
            font-size: 20px;
            cursor: pointer;
          }
          .peo_photo{
            width: 30px;
            height: 30px;
            border-radius: 50%;
            overflow: hidden;
            margin-top: auto;
            margin-bottom: auto;
            margin-right: 8px;
            img{
              width: 100%;
              height: 100%;
            }
          }
          .peo_name{
            font-size: 14px;
            color: #222222;
            line-height: 45px;
          }
        }
      }
    }
  }
</style>

